﻿using System;
using System.Collections.Generic;
using BizControl.Library;
using BizControl.Library.Helpers;

namespace BizControl.Presentation.Infrastructure.Helpers
{
  public static class Priorities
  {
    private static Dictionary<string, int> _priorities = null;
    public static Dictionary<string, int> ObjectPrioritiesAsDictionary
    {
      get
      {
        // TO DO: lock
        if (_priorities == null)
        {
          var values = Enum.GetValues(typeof(ObjectPriority));
          _priorities = new Dictionary<string, int>();
          foreach (var val in values)
            _priorities.Add(((ObjectPriority)val).GetLocalizedDescription(), (int)Enum.Parse(typeof(ObjectPriority), val.ToString()));
        }
        return _priorities;
      }
    }
  }
}
